from sympy.combinatorics.generators import symmetric
from sympy.abc import x as _x
import sympy as _mp
from rizefs.mass import get_static_mass
from rizefs import *

def main():
    gcd0 = 1
    dict0 ={} 
    start = []
    part192 = [192, 216, 240, 256, 288, 320, 360, 384]
    for j in symmetric(8):
        a,b,c = 0 , 0,0
        start0 = start.copy()
        ls1 = j.list()
        mid0 = [part192[j] for j in ls1]
        start0.extend(mid0)
        start0.extend([_x])
        if (start0[0] == part192[4] and start0[4] == part192[0]) :
            a = 1
        if (start0[1] == part192[6] and start0[6] == part192[1]) :
            b = 1
        if (start0[3] == part192[5] and start0[5] == part192[3]) :
            c = 1
        abc = sum([a,b,c])
        if abc >=1:
            m0 = _mp.Matrix(3,3,start0)
            md0 = m0.det()
            if md0 == 0:
                _, gsm0 =  get_static_mass(m0)
                gcd2 = _mp.gcd(gsm0,0o5155040) 
                if gcd2 > gcd0:
                    print (m0.values()[:-1],gcd2)
                    gcd0 = gcd2

main()

